

package com.kimo.shop.service;


import com.baomidou.mybatisplus.extension.service.IService;
import com.kimo.shop.bean.dto.FlowAnalysisDto;
import com.kimo.shop.bean.dto.SystemDto;
import com.kimo.shop.bean.model.FlowLog;
import com.kimo.shop.bean.model.FlowUserAnalysis;
import com.kimo.shop.bean.model.Order;
import com.kimo.shop.bean.param.CustomerRetainRespParam;
import com.kimo.shop.bean.param.CustomerRetainedReqParam;
import com.kimo.shop.bean.param.FlowAnalysisParam;
import com.kimo.shop.bean.param.FlowUserAnalysisParam;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 *
 *
 * @author kimo-taozhouchuan
 * @date 2020-07-17 09:50:13
 */
public interface FlowUserAnalysisService extends IService<FlowUserAnalysis> {

    void statisticalUserData(Map<String, List<FlowLog>> flowAnalysisLogMap, Date startTime, Map<String, FlowUserAnalysis> flowUserAnalysisMap);

    void statisticalPlaceOrderOrPayData(FlowLog flowLog, Order order, Map<String, FlowUserAnalysis> flowUserAnalysisMap);

    void getUserAnalysisData(FlowUserAnalysisParam flowUserAnalysisParam);

    FlowAnalysisDto getFlowAnalysisData(FlowAnalysisParam flowAnalysisParam);

    List<FlowAnalysisDto> flowTrend(FlowAnalysisParam flowAnalysisParam);

    List<FlowAnalysisDto> flowSour(FlowAnalysisParam flowAnalysisParam);

    SystemDto systemTypeNums(FlowAnalysisParam flowAnalysisParam);

    /**
     * 获取用户留存率, 统计用户第一次访问后，之后的几个月的留存用户数
     * @param param 条件查询参数
     * @return 访问留存信息列表
     */
    List<CustomerRetainRespParam> getVisitRetained(CustomerRetainedReqParam param);

    /**
     * 清除用户访问留存数据缓存
     * @param param
     */
    void removeCacheVisitRetained(CustomerRetainedReqParam param);

    Integer countAddCartUserNum(Date startTime, Date endTime);
}
